//1. 导入模块

const http = require("http");
const fs = require("fs");
const path = require("path");
// 2. 创建WEB服务器实力
const serve = http.createServer();
//当有人请求时，会打印信息
serve.on("request", function (req, res) {
//   res.end("welecome  ", "utf-8", function () {
//     console.log("ok");
//   });
  fs.readFile(path.join(__dirname, './clock/index.html'), 'utf-8', function(err, data) {
      res.end(data)
  })
});

serve.listen(80, function () {
  console.log("server running at http://127.0.0.1");
});
